.class Lcom/xingbook/ting/fragment/t;
.super Landroid/widget/BaseAdapter;


# instance fields
.field final synthetic a:Lcom/xingbook/ting/fragment/TingPlayListFragment;

.field private b:Ljava/util/List;

.field private c:Landroid/content/Context;


# direct methods
.method public constructor <init>(Lcom/xingbook/ting/fragment/TingPlayListFragment;Landroid/content/Context;)V
    .locals 4

    const/4 v3, 0x0

    iput-object p1, p0, Lcom/xingbook/ting/fragment/t;->a:Lcom/xingbook/ting/fragment/TingPlayListFragment;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    iput-object v3, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    iput-object v3, p0, Lcom/xingbook/ting/fragment/t;->c:Landroid/content/Context;

    iput-object p2, p0, Lcom/xingbook/ting/fragment/t;->c:Landroid/content/Context;

    :try_start_0
    iget-object v0, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    if-nez v0, :cond_0

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    invoke-static {p2}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/ting/play/j;->c()Lcom/xingbook/audio/b/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/audio/b/a;->h()Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    :goto_1
    return-void

    :cond_1
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    iget-object v2, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    check-cast v0, Lcom/xingbook/audio/b/b;

    invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    iput-object v3, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    goto :goto_1
.end method


# virtual methods
.method public getCount()I
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    goto :goto_0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    iget-object v1, p0, Lcom/xingbook/ting/fragment/t;->b:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    rem-int v1, p1, v1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    goto :goto_0
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5

    const/4 v1, 0x0

    const/4 v4, 0x0

    invoke-virtual {p0, p1}, Lcom/xingbook/ting/fragment/t;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/audio/b/b;

    if-nez v0, :cond_0

    move-object p2, v1

    :goto_0
    return-object p2

    :cond_0
    if-nez p2, :cond_1

    iget-object v2, p0, Lcom/xingbook/ting/fragment/t;->c:Landroid/content/Context;

    const v3, 0x7f030049

    invoke-static {v2, v3, v1}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    new-instance v2, Lcom/xingbook/ting/fragment/u;

    invoke-direct {v2, p0}, Lcom/xingbook/ting/fragment/u;-><init>(Lcom/xingbook/ting/fragment/t;)V

    const v1, 0x7f0a023a

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    iput-object v1, v2, Lcom/xingbook/ting/fragment/u;->a:Landroid/view/View;

    const v1, 0x7f0a023b

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    iput-object v1, v2, Lcom/xingbook/ting/fragment/u;->b:Landroid/widget/TextView;

    invoke-virtual {p2, v2}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    move-object v1, v2

    :goto_1
    iget-object v2, p0, Lcom/xingbook/ting/fragment/t;->c:Landroid/content/Context;

    invoke-static {v2}, Lcom/xingbook/ting/play/j;->a(Landroid/content/Context;)Lcom/xingbook/ting/play/j;

    move-result-object v2

    invoke-virtual {v2}, Lcom/xingbook/ting/play/j;->d()I

    move-result v2

    if-ne p1, v2, :cond_2

    iget-object v2, v1, Lcom/xingbook/ting/fragment/u;->a:Landroid/view/View;

    invoke-virtual {v2, v4}, Landroid/view/View;->setVisibility(I)V

    const v2, 0x5590c381

    invoke-virtual {p2, v2}, Landroid/view/View;->setBackgroundColor(I)V

    :goto_2
    iget-object v1, v1, Lcom/xingbook/ting/fragment/u;->b:Landroid/widget/TextView;

    invoke-virtual {v0}, Lcom/xingbook/audio/b/b;->u()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    :cond_1
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/xingbook/ting/fragment/u;

    goto :goto_1

    :cond_2
    invoke-virtual {p2, v4}, Landroid/view/View;->setBackgroundColor(I)V

    iget-object v2, v1, Lcom/xingbook/ting/fragment/u;->a:Landroid/view/View;

    const/4 v3, 0x4

    invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V

    goto :goto_2
.end method
